#include <cstring>
#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;

string head[100005];
string content[100005];

string words[1000];
int cur;

int main() {
    string s1;
    getline(cin, s1);

    char* ss1 = (char*)s1.c_str();
    cout << ss1 << endl;

    char *p = strtok(ss1, " ,#*");
    while(p){
        cout << p << endl;
        p = strtok(NULL, " #*,");
    }
    // cout << ss1 << endl;
    return 0;
}